<template>
  <div>
    <BasicTable @register="registerTable" :rowSelection="rowSelection" :dataSource="dataSource">
      <template #sendCustom="{ text, record }">
        <a-tag color="blue">{{ text ? '是' : '否' }}</a-tag>
      </template>
      <template #contentCustom="{ text, record }">
        <a>{{ text }}</a>
      </template>
    </BasicTable>
  </div>
</template>
<script lang="ts" name="alarm-list" setup>
  import { ref, reactive } from 'vue';
  import { BasicTable, TableAction } from '/@/components/Table';
  import { useModal } from '/@/components/Modal';
  import { list } from './history.api';
  import { columns, searchFormSchema } from './history.data';
  import { useListPage } from '/@/hooks/system/useListPage';

  // 列表页面公共参数、方法
  const { tableContext } = useListPage({
    tableProps: {
      title: '告警日志',
      //   api: list,
      columns: columns,
      showIndexColumn: true,
      showActionColumn: false,
      formConfig: {
        schemas: searchFormSchema,
      },
    },
  });

  const [registerTable, { reload }] = tableContext;

  const dataSource = reactive([
    {
      time: '2024-03-05 09:20:36',
      id: '2ef94629157444e48ac07c3ac599df93',
      alarmType: 'CPU_LOAD_ALARM',
      content: '当前主机【192.168.3.77】CPU占用1.0,请及时处理',
      send: true,
    },
  ]);
</script>